<script setup lang="ts">
import type { PageIn } from '$/client'
import { Pagination as VPagination } from 'vexip-ui'

defineProps<{
  total?: number
}>()
defineEmits<{
  (e: 'change'): void
}>()

const params = defineModel<PageIn>({ required: true })
</script>

<template>
  <VPagination
    v-model:active="params.page"
    v-model:page-size="params.size"
    :total="total"
    @change="$emit('change')"
    @page-size-change="$emit('change')"
  />
</template>
